home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / ncommpoll.thor < prev    next >
Text File  |  1998-05-24  |  2KB  |  77 lines

  1. /* NCommPoll.thor by Troels Walsted Hansen
  2. ** $VER: NCommPoll.thor 2.0 (1.11.94)
  3. **
  4. ** An ARexx script that automates NComm dialing of BBSs chosen
  5. ** from a multiselectable list.
  6. **
  7. ** IMPORTANT: To use this script, the BBSs configured in THOR must
  8. **            have the same name as those in your NComm phonebook.
  9. **
  10. ** New: This version is only for THOR v2.0 or higher.
  11. */
  12.  
  13. options results
  14.  
  15. /* needs THOR and bbsread.library functions */
  16.  
  17. p = ' ' || address() || ' ' || show('P',,)
  18. thorport = pos(' THOR.',p)
  19.  
  20. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  21. else
  22. do
  23.     say 'No THOR port found!'
  24.     exit 10
  25. end
  26.  
  27. if ~show('p', 'BBSREAD') then
  28. do
  29.     address command
  30.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  31.         "WaitForPort BBSREAD"
  32. end
  33.  
  34. /* request BBSs */
  35.  
  36. address(bbsread)
  37. GETBBSLIST stem BBSLIST
  38. if(rc ~= 0) then
  39. do
  40.     address(thorport)
  41.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  42.     exit 5
  43. end
  44.  
  45. address(thorport)
  46. THORTOFRONT
  47. REQUESTLIST instem BBSLIST outstem USERBBSLIST title '"Select BBSs:"' DRAGSELECT MULTISELECT SIZEGADGET
  48. if(rc ~= 0 | USERBBSLIST.COUNT == 0) then exit
  49.  
  50. dialstring = ""
  51.  
  52. do i=1 to USERBBSLIST.COUNT
  53.     dialstring = dialstring || "|" || USERBBSLIST.i
  54. end
  55.  
  56. /* Is NComm already running? If not, start it... */
  57.  
  58. if ~show('p', 'ncomm') then do
  59.     if ~exists("t:NCommStartupScript") then do
  60.         call open(nscript, "t:NCommStartupScript", W)
  61.         call writeln(nscript, "stack 10000")
  62.         call writeln(nscript, "cd NComm:")
  63.         call writeln(nscript, "run <>nil: NComm")
  64.         call close(nscript)
  65.     end
  66.  
  67.     address command
  68.         "execute >nil: t:NCommStartupScript"
  69.         "WaitForPort ncomm"
  70.     if(rc) then exit
  71. end
  72.  
  73. address 'ncomm'
  74. NCOMMTOFRONT
  75. DIAL strip(dialstring, B, "|")
  76. exit
  77.